import java.util.*;
import junit.framework.TestCase;
import android.cs2340UDT.*;

public class JosephTest2 extends TestCase {
	
	public void testDataBase() {
		Database aData = new Database("Test");
		Manager aManager = new Manager();
		User user1 = new User("Name1", "UserName1", "Password", "email", "date", aManager);
		User user2 = new User("Name2", "UserName2", "Password", "email", "date", aManager);
		User user3 = new User("Name3", "UserName3", "Password", "email", "date", aManager);
		User user4 = new User("Name4", "UserName4", "Password", "email", "date", aManager);
		aData.addUser(user1);
		aData.addUser(user2);
		aData.addUser(user3);
		assertTrue("Not in list", aData.hasUserNamed("UserName1"));
		assertFalse("In list", aData.hasUserNamed("UserName4"));
		aData.addUser(user4);
		assertTrue("In the list now", aData.hasUserNamed("UserName4"));
	}
}
